<!DOCTYPE html>
<html>

<head>
    <title>AnguarJs SoundManager2 - SoundCloud</title>
    <link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css" />
    <link rel="stylesheet" href="style.css" />
</head>

<body ng-app="myApp">
    <div class="container" ng-controller="MainCtrl">
        <div class="row">
            <div class="col-md-12">

                <h5>Songs</h5>
                <ul>
                    <li ng-repeat="song in songs">
                        <button music-player="play" add-song="song">{{ song.title }}</button>
                        <button music-player add-song="song">+</button>
                    </li>
                </ul>

                <button play-all="songs">Play all</button>

            </div>
        </div>

        <hr />

        <div class="row">
            <div class="col-md-12">
                <!-- init soundManager2 player -->
                <sound-manager></sound-manager>

                <p>
                    Currently Playing: {{ currentPlaying.title }} by {{ currentPlaying.artist }} ({{ currentPostion }} / {{ currentDuration }})
                </p>

                <div class="seekBase" seek-track>
                    <div class="seekLoad" ng-style="{width : ( progress + '%' ) }"></div>
                </div>
                <br />
                <button play-music>Play</button>
                -
                <button pause-music>Pause</button>
                -
                <button stop-music>Stop</button>
                -
                <button repeat-music>Repeat ({{ repeat }})</button>
                -
                <button play-pause-toggle data-play="Play!" data-pause="Pause!">Play Toggle</button>

                Is Playing: {{ isPlaying }}
                <br/>
                <br/>Volume: {{ volume }} -
                <button music-volume data-type="increase">+</button>
                -
                <button music-volume data-type="decrease">-</button>
                -
                <button mute-music>Mute ({{ mute }})</button>
                <br/>
                <br/>
                <button prev-track>Prev Track</button>
                -
                <button next-track>Next Track</button>
                -
                <button clear-playlist>Clear Playlist</button>
                <br/>
                <br/>
                <h5>Playlist</h5>
                <ul>
                    <li ng-repeat="song in playlist">
                        <a play-from-playlist="song">{{ song.title }}</a>
                        -
                        <a remove-from-playlist="song" data-index="{{$index}}">
                            <small>(remove)</small>
                        </a>
                        <span ng-if="currentPlaying.id == song.id"> - (current)</span>
                    </li>
                </ul>
            </div>
        </div>
    </div>
    
    <script src="//connect.soundcloud.com/sdk.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.19/angular.min.js"></script>
    <script src="../dist/angular-soundmanager2.js"></script>
    <script src="app.js"></script>
</body>

</html>
